package com.meshnetics.gb.util.formatters;

import com.meshnetics.gb.util.checkers.RangeCheckers;

import java.nio.ByteBuffer;

/**
 * NumberFormatter implementation for byte.
 *
 * @author Yury Aserchev (yaserchev@meshnetics.com)
 *         Date: 20.06.2008 15:47:12
 */
final class NumberFormatterByte extends AbstractNumberFormatter {
    protected ByteBuffer getBuffer(final long value) {
        return ByteBuffer.allocate(1).put((byte) value);
    }

    protected void checkRange(final long value) {
        RangeCheckers.BYTE.checkRange(value);
    }
}
